package com.totem.admin.api;

import com.totem.admin.vo.*;
import com.totem.base.model.PageVO;
import com.totem.base.model.Result;
import com.totem.product.vo.ProductPageVO;
import com.totem.product.vo.ProductVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.Valid;
import java.io.IOException;

@Tag(name="AdminInfomationServiceApi", description="资讯后台服务")
public interface AdminInfomationServiceApi {
    @Operation(summary="上传资讯图片", description="")
    @PostMapping(value="/admin/information/upload/file/cover", consumes= MediaType.MULTIPART_FORM_DATA_VALUE)
    @ResponseBody
    Result<FileUrlVO> uploadFileInfoCover(@RequestPart(value="file") MultipartFile file) throws IOException;

    @Operation(summary="添加资讯", description="")
    @PostMapping(value="/admin/information/add")
    @ResponseBody
    Result<AddInformationVO> addInfomation(@RequestBody AddInformationVO vo);

    @Operation(summary="修改资讯", description="")
    @PostMapping(value="/admin/information/update")
    @ResponseBody
    Result<UpdateInformationVO> updateInfomation(@RequestBody UpdateInformationVO vo);

    @Operation(summary="删除资讯", description="")
    @PostMapping(value="/admin/information/delete")
    @ResponseBody
    Result<DeleteInformationVO> deleteInfomation(@RequestBody DeleteInformationVO vo);

    @Operation(summary="分页查询资讯信息")
    @PostMapping("/admin/information/page")
    @ResponseBody
    Result<PageVO<InformationVO>> infomationPage(@RequestBody InformationPageVO vo);
}
